program fact
implicit none
integer :: n,x
integer :: fac
print*,"enter the number"
read*,x
fac=1
do n=1,x
   fac=fac*n
end do
print*,"factorial of",x,"is",fac
end program fact
